﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Assets.Scripts.ProceduralCityGenerator;
using CapturePanorama;
using SizeboxUI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using UnityEngine.XR;

namespace Assets.Scripts.UI.View.Pause
{
	// Token: 0x020003BB RID: 955
	public class VideoSettingsView : SettingsView
	{
		// Token: 0x060019CE RID: 6606 RVA: 0x000A144C File Offset: 0x0009F64C
		private void Start()
		{
			this.mainCamera = Camera.main;
			if (this.mainCamera)
			{
				this.cameraEffects = this.mainCamera.GetComponent<CameraEffectsSettings>();
				this.vrCamera = this.mainCamera.GetComponent<VRCamera>();
				if (GameController.Instance != null)
				{
					this.capturePanorama = GameController.Instance.panorama;
				}
				base.GetComponentInChildren<Text>().text = "Video";
			}
			base.AddHeader("Display");
			this.DropVideoMode = base.AddDropdown("Fullscreen Mode", new List<Dropdown.OptionData>
			{
				new Dropdown.OptionData("Windowed"),
				new Dropdown.OptionData("Fullscreen")
			});
			this.DropVideoMode.onValueChanged.AddListener(new UnityAction<int>(this.OnSetVideoMode));
			List<string> list = VideoSettingsView.StringResolutions();
			if (list.Count > 0)
			{
				Debug.Log("loading resolutions");
				List<Dropdown.OptionData> options = base.CreateTextOptions(list.ToArray(), false);
				this.DropRes = base.AddDropdown("Resolution", options);
				this.DropRes.captionText.text = VideoSettingsView.Res2Str(VideoSettingsView.WindowResolution());
				UnityEvent<int> onValueChanged = this.DropRes.onValueChanged;
				if (VideoSettingsView.<>f__mg$cache0 == null)
				{
					VideoSettingsView.<>f__mg$cache0 = new UnityAction<int>(VideoSettingsView.SetRes);
				}
				onValueChanged.AddListener(VideoSettingsView.<>f__mg$cache0);
			}
			if (this.vrCamera && this.vrCamera.vrSupported)
			{
				List<Dropdown.OptionData> options2 = base.CreateTextOptions(XRSettings.supportedDevices, true);
				this.Drop3d = base.AddDropdown("3D/VR Mode", options2);
				this.Drop3d.onValueChanged.AddListener(delegate(int value)
				{
					this.vrCamera.SelectXR(value);
				});
			}
			this.DropVsync = base.AddDropdown("Vsync", base.CreateTextOptions(new string[]
			{
				"None",
				"Every V Blank",
				"Every Second V Blank"
			}, true));
			this.DropVsync.value = QualitySettings.vSyncCount;
			this.DropVsync.onValueChanged.AddListener(delegate(int value)
			{
				VideoSettingsView.UpdateVsyncMode(value, true);
			});
			this.fpsSlider = base.AddInputSlider("FPS", 10f, 300f);
			this.fpsSlider.slider.value = (float)GlobalPreferences.Fps.value;
			base.SetInputSliderInput(this.fpsSlider, this.fpsSlider.slider.value, "####");
			this.fpsSlider.slider.onValueChanged.AddListener(delegate(float v)
			{
				this.UpdateFpsSlider(this.fpsSlider, v, true);
			});
			InputField input4 = this.fpsSlider.input;
			input4.onValidateInput = (InputField.OnValidateInput)Delegate.Combine(input4.onValidateInput, new InputField.OnValidateInput((string input, int charIndex, char addedChar) => base.ValidateDigit(addedChar)));
			this.fovSlider = base.AddInputSlider("FOV", 45f, 110f);
			this.fovSlider.slider.value = GlobalPreferences.Fov.value;
			base.SetInputSliderInput(this.fovSlider, this.fovSlider.slider.value, "####");
			this.fovSlider.slider.onValueChanged.AddListener(new UnityAction<float>(this.OnFovChanged));
			InputField input2 = this.fovSlider.input;
			input2.onValidateInput = (InputField.OnValidateInput)Delegate.Combine(input2.onValidateInput, new InputField.OnValidateInput((string input, int charIndex, char addedChar) => base.ValidateDigit(addedChar)));
			this.uiScaleSlider = base.AddInputSlider("UI Scale", 0.5f, 3.2f);
			this.uiScaleSlider.slider.onValueChanged.AddListener(delegate(float value)
			{
				this.UpdateUIScaleSlider(value, true);
			});
			this.uiScaleSlider.slider.value = GlobalPreferences.UIScale.value;
			base.SetInputSliderInput(this.uiScaleSlider, this.uiScaleSlider.slider.value, "0.00");
			InputField input3 = this.uiScaleSlider.input;
			input3.onValidateInput = (InputField.OnValidateInput)Delegate.Combine(input3.onValidateInput, new InputField.OnValidateInput((string input, int charIndex, char addedChar) => base.ValidateNumber(addedChar)));
			base.AddHeader("Quality");
			this.DropQuality = base.AddDropdown("Overall Quality", base.CreateTextOptions(QualitySettings.names, true));
			this.DropQuality.value = QualitySettings.GetQualityLevel();
			this.DropQuality.onValueChanged.AddListener(new UnityAction<int>(this.SetQualityLevel));
			this.DropAntiAlias = base.AddDropdown("Anti-Aliasing", base.CreateTextOptions(new string[]
			{
				"None",
				"x2",
				"x4",
				"x8"
			}, false));
			this.DropAntiAlias.value = GlobalPreferences.AntiAlias.value;
			this.DropAntiAlias.onValueChanged.AddListener(delegate(int value)
			{
				VideoSettingsView.UpdateAntiAliasingMode(value, true);
			});
			this.clipDistanceSlider = base.AddSlider("Clip Distance", 1f, 75f);
			this.clipDistanceSlider.onValueChanged.AddListener(delegate(float v)
			{
				this.ClipDistanceChanged(v, true);
			});
			this.clipDistanceSlider.value = GlobalPreferences.ClipDistance.value;
			this.detailDistanceSlider = base.AddInputSlider("Detail Distance", 0.2f, 4.65f);
			this.detailDistanceSlider.slider.value = QualitySettings.lodBias;
			base.SetInputSliderInput(this.detailDistanceSlider, this.detailDistanceSlider.slider.value, "0.00");
			this.detailDistanceSlider.slider.onValueChanged.AddListener(delegate(float value)
			{
				this.UpdateDistance(value, true);
			});
			base.AddHeader("Effects");
			this.depthOfFieldToggle = base.AddToggle("Depth of Field");
			this.depthOfFieldToggle.onValueChanged.AddListener(delegate(bool value)
			{
				this.UpdateDepthOfFieldToggle(value, true);
			});
			this.motionBlurToggle = base.AddToggle("Motion Blur");
			this.motionBlurToggle.onValueChanged.AddListener(delegate(bool value)
			{
				this.UpdateBlurToggle(value, true);
			});
			this.smokeToggle = base.AddToggle("Smoke Particles");
			this.smokeToggle.onValueChanged.AddListener(delegate(bool v)
			{
				VideoSettingsView.UpdateSmokeToggleChanged(v);
			});
			this.bloomSlider = base.AddToggleSlider("Bloom", 0.1f, 5f);
			this.bloomSlider.slider.onValueChanged.AddListener(delegate(float v)
			{
				this.UpdateBloomSlider(v, true);
			});
			this.bloomSlider.toggle.onValueChanged.AddListener(delegate(bool V)
			{
				this.UpdateBloomToggle(V, true);
			});
			this.Shadows = base.AddToggleSlider("Shadows", 100f, 50000f);
			this.Shadows.toggle.onValueChanged.AddListener(delegate(bool v)
			{
				this.UpdateShadowToggle(v, true);
			});
			this.Shadows.slider.onValueChanged.AddListener(delegate(float v)
			{
				this.UpdateShadowSlider(v, true);
			});
			base.AddHeader("Misc");
			this.toggleFPS = base.AddToggle("Display FPS");
			this.toggleFPS.onValueChanged.AddListener(delegate(bool value)
			{
				this.UpdateShowFpsToggle(value, true);
			});
			this.shakeSlider = base.AddSlider("Camera Shake", 0f, 10f);
			this.shakeSlider.value = GlobalPreferences.ShakeMultiplier.value;
			UnityEvent<float> onValueChanged2 = this.shakeSlider.onValueChanged;
			if (VideoSettingsView.<>f__mg$cache1 == null)
			{
				VideoSettingsView.<>f__mg$cache1 = new UnityAction<float>(VideoSettingsView.OnShakeChanged);
			}
			onValueChanged2.AddListener(VideoSettingsView.<>f__mg$cache1);
			this.BackgroundMaxFps = base.AddToggle("Run full speed when unfocused");
			this.BackgroundMaxFps.isOn = GlobalPreferences.BackgroundMaxFps.value;
			this.BackgroundMaxFps.onValueChanged.AddListener(delegate(bool value)
			{
				GlobalPreferences.BackgroundMaxFps.value = value;
			});
			base.AddHeader("System Infomation");
			base.AddReadOnly("Processor", SystemInfo.processorType.ToString());
			base.AddReadOnly("3D Accelerator", SystemInfo.graphicsDeviceName.ToString());
			base.AddReadOnly("Rendering API", SystemInfo.graphicsDeviceVersion.ToString());
			base.AddHeader("360 Screenshot Settings");
			this.imageFormatDropdown = base.AddDropdown("Image Format", base.CreateTextOptions(new string[]
			{
				"JPEG",
				"BMP",
				"PNG"
			}, true));
			this.imageFormatDropdown.value = GlobalPreferences.ImageFormat.value;
			this.imageFormatDropdown.onValueChanged.AddListener(delegate(int value)
			{
				this.UpdatePanoramaImageFormat(value);
			});
			this.imageWidthDropdown = base.AddDropdown("Image Width", base.CreateTextOptions(new string[]
			{
				"1024",
				"2048",
				"4096",
				"8192"
			}, false));
			this.imageWidthDropdown.value = GlobalPreferences.ImageFormat.value;
			this.imageWidthDropdown.onValueChanged.AddListener(delegate(int value)
			{
				this.UpdatePanoramaImageWidth(value);
			});
			this.useGpuToggle = base.AddToggle("Use GPU Computation (faster)");
			this.useGpuToggle.onValueChanged.AddListener(delegate(bool value)
			{
				this.EnableGpuComputation(value);
			});
			this.useFadeToggle = base.AddToggle("Fade out when taking screenshot");
			this.useFadeToggle.onValueChanged.AddListener(delegate(bool value)
			{
				this.EnableFadeOut(value);
			});
			this.UpdateValues();
			this.initialized = true;
		}

		// Token: 0x060019CF RID: 6607 RVA: 0x000A1DD4 File Offset: 0x0009FFD4
		protected override void UpdateValues()
		{
			if (this.cameraEffects)
			{
				this.clipDistanceSlider.value = this.cameraEffects.nearFarCameraTreshold;
				this.depthOfFieldToggle.isOn = this.cameraEffects.GetDepthOfFieldValue();
				this.motionBlurToggle.isOn = this.cameraEffects.GetMotionBlur();
				this.Shadows.toggle.isOn = this.cameraEffects.GetShadowsValue();
				this.Shadows.slider.value = this.cameraEffects.GetShadowDistance();
			}
			else
			{
				this.clipDistanceSlider.value = GlobalPreferences.ClipDistance.value;
				this.depthOfFieldToggle.isOn = GlobalPreferences.DepthOfField.value;
				this.motionBlurToggle.isOn = GlobalPreferences.MotionBlur.value;
				this.Shadows.toggle.isOn = GlobalPreferences.Shadows.value;
				this.Shadows.slider.value = GlobalPreferences.ShadowDistance.value;
			}
			this.detailDistanceSlider.slider.value = GlobalPreferences.ViewDistance.value;
			this.smokeToggle.isOn = GlobalPreferences.SmokeEnabled.value;
			this.uiScaleSlider.slider.value = GlobalPreferences.UIScale.value;
			if (this.mainCamera)
			{
				this.toggleFPS.isOn = MainView.fpsDisplayEnabled;
			}
			else
			{
				this.toggleFPS.isOn = GlobalPreferences.FpsCount.value;
			}
			if (this.cameraEffects && this.cameraEffects.CurrentProfile)
			{
				this.bloomSlider.toggle.isOn = this.cameraEffects.CurrentProfile.bloom.enabled;
				this.bloomSlider.slider.value = this.cameraEffects.CurrentProfile.bloom.settings.bloom.intensity;
			}
			else
			{
				this.bloomSlider.toggle.isOn = GlobalPreferences.Bloom.value;
				this.bloomSlider.slider.value = GlobalPreferences.BloomValue.value;
			}
			this.DropVideoMode.value = this.GetVideoModeIndex();
			if (this.imageFormatDropdown != null)
			{
				if (this.capturePanorama != null)
				{
					this.imageFormatDropdown.value = this.capturePanorama.GetImageFormat();
				}
				else
				{
					this.imageFormatDropdown.value = GlobalPreferences.ImageFormat.value;
				}
			}
			if (this.imageWidthDropdown != null)
			{
				if (this.capturePanorama != null)
				{
					this.imageWidthDropdown.value = this.capturePanorama.GetImageWidth();
				}
				else
				{
					this.imageWidthDropdown.value = GlobalPreferences.ImageWidth.value;
				}
			}
			if (this.useGpuToggle != null)
			{
				if (this.capturePanorama != null)
				{
					this.useGpuToggle.isOn = this.capturePanorama.UseGpuTransform;
				}
				else
				{
					this.useGpuToggle.isOn = GlobalPreferences.UseGpu.value;
				}
			}
			if (this.useFadeToggle != null)
			{
				if (this.capturePanorama != null)
				{
					this.useFadeToggle.isOn = this.capturePanorama.FadeDuringCapture;
				}
				else
				{
					this.useFadeToggle.isOn = GlobalPreferences.UseFade.value;
				}
			}
		}

		// Token: 0x060019D0 RID: 6608 RVA: 0x000A2172 File Offset: 0x000A0372
		public void UpdateBloomSlider(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetBloom(v);
			}
			if (write)
			{
				GlobalPreferences.BloomValue.value = v;
			}
		}

		// Token: 0x060019D1 RID: 6609 RVA: 0x000A21A1 File Offset: 0x000A03A1
		public void UpdateBloomToggle(bool v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetBloom(v);
			}
			if (write)
			{
				GlobalPreferences.Bloom.value = v;
			}
		}

		// Token: 0x060019D2 RID: 6610 RVA: 0x000A21D0 File Offset: 0x000A03D0
		public void OnFovChanged(float value)
		{
			PlayerCamera.defaultFOV = value;
			this.mainCamera.fieldOfView = value;
			base.SetInputSliderInput(this.fovSlider, value, "####");
			GlobalPreferences.Fov.value = value;
		}

		// Token: 0x060019D3 RID: 6611 RVA: 0x000A2204 File Offset: 0x000A0404
		public void UpdateFpsSlider(SettingsView.InputSlider i, float value, bool write = false)
		{
			int num = (int)value;
			Application.targetFrameRate = num;
			if (write)
			{
				GlobalPreferences.Fps.value = num;
			}
			base.SetInputSliderInput(i, num);
		}

		// Token: 0x060019D4 RID: 6612 RVA: 0x000A2234 File Offset: 0x000A0434
		public void UpdateUIScaleSlider(float value, bool write = false)
		{
			if (UnityEngine.Object.FindObjectOfType<MainMenuSettingsController>() == null)
			{
				GameController.Instance.view.mainCanvas.GetComponent<Canvas>().scaleFactor = value;
			}
			else
			{
				UnityEngine.Object.FindObjectOfType<Canvas>().scaleFactor = value;
			}
			if (Screen.width < 3840 && Screen.height < 2160 && value > 1.8f)
			{
				value = 1.8f;
			}
			base.SetInputSliderInput(this.uiScaleSlider, value, "0.00");
			if (write)
			{
				GlobalPreferences.UIScale.value = value;
			}
		}

		// Token: 0x060019D5 RID: 6613 RVA: 0x000A22CE File Offset: 0x000A04CE
		public void UpdateShowFpsToggle(bool value, bool write = false)
		{
			if (this.main)
			{
				this.main.ShowFPS(value);
			}
			if (write)
			{
				GlobalPreferences.FpsCount.value = value;
			}
		}

		// Token: 0x060019D6 RID: 6614 RVA: 0x000A22FD File Offset: 0x000A04FD
		public void UpdateBlurToggle(bool value, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetMotionBlur(value);
			}
			if (write)
			{
				GlobalPreferences.MotionBlur.value = value;
			}
		}

		// Token: 0x060019D7 RID: 6615 RVA: 0x000A232C File Offset: 0x000A052C
		public void ClipDistanceChanged(float value, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.nearFarCameraTreshold = value;
			}
			if (write)
			{
				GlobalPreferences.ClipDistance.value = value;
			}
		}

		// Token: 0x060019D8 RID: 6616 RVA: 0x000A235C File Offset: 0x000A055C
		private void SetQualityLevel(int v)
		{
			QualitySettings.SetQualityLevel(v);
			VideoSettingsView.UpdateAntiAliasingMode(this.DropAntiAlias.value, false);
			this.UpdateDistance(GlobalPreferences.ViewDistance.value, false);
			VideoSettingsView.UpdateVsyncMode(this.DropVsync.value, false);
			this.UpdateShadowToggle(GlobalPreferences.Shadows.value, false);
			this.UpdateShadowSlider(GlobalPreferences.ShadowDistance.value, false);
		}

		// Token: 0x060019D9 RID: 6617 RVA: 0x000A23C4 File Offset: 0x000A05C4
		public void UpdateAoToggle(bool v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetAmbientOcclusion(v);
			}
			if (write)
			{
				GlobalPreferences.AmbientOcclusion.value = v;
			}
		}

		// Token: 0x060019DA RID: 6618 RVA: 0x000A23F3 File Offset: 0x000A05F3
		public void UpdateAoSlider(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetAmbientOcclusion(v);
			}
			if (write)
			{
				GlobalPreferences.AmbientOcclusionValue.value = v;
			}
		}

		// Token: 0x060019DB RID: 6619 RVA: 0x000A2422 File Offset: 0x000A0622
		public void UpdateColorGain(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetColorGain(v, false);
			}
			if (write)
			{
				GlobalPreferences.ColorGain.value = v;
			}
		}

		// Token: 0x060019DC RID: 6620 RVA: 0x000A2452 File Offset: 0x000A0652
		public void UpdateColorValue(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetColorValue(v, false);
			}
			if (write)
			{
				GlobalPreferences.ColorValue.value = v;
			}
		}

		// Token: 0x060019DD RID: 6621 RVA: 0x000A2482 File Offset: 0x000A0682
		public void UpdateFogToggle(bool v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetAmbientOcclusion(v);
			}
			if (write)
			{
				GlobalPreferences.Haze.value = v;
			}
		}

		// Token: 0x060019DE RID: 6622 RVA: 0x000A24B1 File Offset: 0x000A06B1
		public void UpdateFogSlider(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetHaze(v);
			}
			if (write)
			{
				GlobalPreferences.HazeValue.value = v;
			}
		}

		// Token: 0x060019DF RID: 6623 RVA: 0x000A24E0 File Offset: 0x000A06E0
		public void UpdateLensToggle(bool v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetLensAberration(v);
			}
		}

		// Token: 0x060019E0 RID: 6624 RVA: 0x000A24FE File Offset: 0x000A06FE
		public void UpdateLensSlider(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetLensAberration(v);
			}
			if (write)
			{
				GlobalPreferences.ChromaticAberration.value = v;
			}
		}

		// Token: 0x060019E1 RID: 6625 RVA: 0x000A252D File Offset: 0x000A072D
		public void UpdateShadowToggle(bool v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.EnableShadows(v);
			}
			if (write)
			{
				GlobalPreferences.Shadows.value = v;
			}
		}

		// Token: 0x060019E2 RID: 6626 RVA: 0x000A255C File Offset: 0x000A075C
		public void UpdateShadowSlider(float v, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.SetShadowDistance(v);
			}
			if (write)
			{
				GlobalPreferences.ShadowDistance.value = v;
			}
		}

		// Token: 0x060019E3 RID: 6627 RVA: 0x000A258C File Offset: 0x000A078C
		public static void UpdateAntiAliasingMode(int v, bool write = false)
		{
			switch (v)
			{
			case 1:
				QualitySettings.antiAliasing = 2;
				break;
			case 2:
				QualitySettings.antiAliasing = 4;
				break;
			case 3:
				QualitySettings.antiAliasing = 8;
				break;
			default:
				QualitySettings.antiAliasing = 0;
				break;
			}
			if (write)
			{
				GlobalPreferences.AntiAlias.value = v;
			}
		}

		// Token: 0x060019E4 RID: 6628 RVA: 0x000A25EF File Offset: 0x000A07EF
		public static void UpdateVsyncMode(int a, bool write = false)
		{
			QualitySettings.vSyncCount = a;
			if (write)
			{
				GlobalPreferences.Vsync.value = a;
			}
		}

		// Token: 0x060019E5 RID: 6629 RVA: 0x000A2608 File Offset: 0x000A0808
		public void UpdateDistance(float value, bool write = false)
		{
			QualitySettings.lodBias = value;
			base.SetInputSliderInput(this.detailDistanceSlider, value, "0.00");
			if (write)
			{
				GlobalPreferences.ViewDistance.value = value;
			}
		}

		// Token: 0x060019E6 RID: 6630 RVA: 0x000A2633 File Offset: 0x000A0833
		public static void OnShakeChanged(float value)
		{
			if (PlayerCamera.instance)
			{
				PlayerCamera.shakeMultipler = value;
			}
			GlobalPreferences.ShakeMultiplier.value = value;
		}

		// Token: 0x060019E7 RID: 6631 RVA: 0x000A2655 File Offset: 0x000A0855
		public static void UpdateSmokeToggleChanged(bool value)
		{
			CityBuilding.smokeEffectEnabled = value;
			GlobalPreferences.SmokeEnabled.value = value;
		}

		// Token: 0x060019E8 RID: 6632 RVA: 0x000A2668 File Offset: 0x000A0868
		private void UpdatePanoramaImageFormat(int value)
		{
			GlobalPreferences.ImageFormat.value = value;
			if (this.capturePanorama != null)
			{
				this.capturePanorama.SetImageFormat(value);
			}
		}

		// Token: 0x060019E9 RID: 6633 RVA: 0x000A2692 File Offset: 0x000A0892
		private void UpdatePanoramaImageWidth(int value)
		{
			GlobalPreferences.ImageWidth.value = value;
			if (this.capturePanorama != null)
			{
				this.capturePanorama.SetImageWidth(value);
			}
		}

		// Token: 0x060019EA RID: 6634 RVA: 0x000A26BC File Offset: 0x000A08BC
		private void EnableGpuComputation(bool value)
		{
			GlobalPreferences.UseGpu.value = value;
			if (this.capturePanorama != null)
			{
				this.capturePanorama.UseGpu(value);
			}
		}

		// Token: 0x060019EB RID: 6635 RVA: 0x000A26E6 File Offset: 0x000A08E6
		private void EnableFadeOut(bool value)
		{
			GlobalPreferences.UseFade.value = value;
			if (this.capturePanorama != null)
			{
				this.capturePanorama.UseFade(value);
			}
		}

		// Token: 0x060019EC RID: 6636 RVA: 0x000A2710 File Offset: 0x000A0910
		private static List<string> StringResolutions()
		{
			IEnumerable<Resolution> resolutions = Screen.resolutions;
			if (VideoSettingsView.<>f__mg$cache2 == null)
			{
				VideoSettingsView.<>f__mg$cache2 = new Func<Resolution, string>(VideoSettingsView.Res2Str);
			}
			return resolutions.Select(VideoSettingsView.<>f__mg$cache2).ToList<string>();
		}

		// Token: 0x060019ED RID: 6637 RVA: 0x000A2740 File Offset: 0x000A0940
		private static Resolution WindowResolution()
		{
			return new Resolution
			{
				width = Screen.width,
				height = Screen.height,
				refreshRate = Screen.currentResolution.refreshRate
			};
		}

		// Token: 0x060019EE RID: 6638 RVA: 0x000A2784 File Offset: 0x000A0984
		private static string Res2Str(Resolution res)
		{
			if (Screen.fullScreen)
			{
				return string.Concat(new object[]
				{
					res.width,
					"x",
					res.height,
					" @ ",
					res.refreshRate,
					"Hz"
				});
			}
			return res.width + "x" + res.height;
		}

		// Token: 0x060019EF RID: 6639 RVA: 0x000A2810 File Offset: 0x000A0A10
		public void UpdateDepthOfFieldToggle(bool value, bool write = false)
		{
			if (this.cameraEffects && this.cameraEffects.depthOfField)
			{
				this.cameraEffects.depthOfField.enabled = value;
				this.cameraEffects.UpdateDepth();
			}
			if (write)
			{
				GlobalPreferences.DepthOfField.value = value;
			}
		}

		// Token: 0x060019F0 RID: 6640 RVA: 0x000A2870 File Offset: 0x000A0A70
		public void UpdateAmbientOcclusionToggle(bool value, bool write = false)
		{
			if (this.cameraEffects)
			{
				this.cameraEffects.CurrentProfile.ambientOcclusion.enabled = value;
				this.cameraEffects.UpdateDepth();
			}
			if (write)
			{
				GlobalPreferences.AmbientOcclusion.value = value;
			}
		}

		// Token: 0x060019F1 RID: 6641 RVA: 0x000A28C0 File Offset: 0x000A0AC0
		private static void SetRes(int v)
		{
			string a = VideoSettingsView.Res2Str(VideoSettingsView.WindowResolution());
			string b = VideoSettingsView.Res2Str(Screen.resolutions[v]);
			if (a != b)
			{
				Screen.SetResolution(Screen.resolutions[v].width, Screen.resolutions[v].height, Screen.fullScreenMode);
			}
		}

		// Token: 0x060019F2 RID: 6642 RVA: 0x000A2924 File Offset: 0x000A0B24
		private void OnSetVideoMode(int modeIndex)
		{
			FullScreenMode fullScreenMode = FullScreenMode.Windowed;
			if (modeIndex == 1)
			{
				fullScreenMode = FullScreenMode.FullScreenWindow;
			}
			if (fullScreenMode != Screen.fullScreenMode)
			{
				if (fullScreenMode == FullScreenMode.Windowed && (Screen.height >= Screen.currentResolution.height || Screen.width >= Screen.currentResolution.width))
				{
					Screen.SetResolution(Screen.currentResolution.width - 100, Screen.currentResolution.height - 100, fullScreenMode);
				}
				else
				{
					Screen.SetResolution(Screen.width, Screen.height, fullScreenMode);
				}
			}
		}

		// Token: 0x060019F3 RID: 6643 RVA: 0x000A29C4 File Offset: 0x000A0BC4
		private int GetVideoModeIndex()
		{
			switch (Screen.fullScreenMode)
			{
			case FullScreenMode.ExclusiveFullScreen:
				return 2;
			case FullScreenMode.FullScreenWindow:
				return 1;
			case FullScreenMode.MaximizedWindow:
				return 2;
			case FullScreenMode.Windowed:
				return 0;
			default:
				return 0;
			}
		}

		// Token: 0x04001BCD RID: 7117
		private Dropdown DropVideoMode;

		// Token: 0x04001BCE RID: 7118
		private Dropdown Drop3d;

		// Token: 0x04001BCF RID: 7119
		private Dropdown DropRes;

		// Token: 0x04001BD0 RID: 7120
		private Dropdown DropQuality;

		// Token: 0x04001BD1 RID: 7121
		private Dropdown DropAntiAlias;

		// Token: 0x04001BD2 RID: 7122
		private Dropdown DropVsync;

		// Token: 0x04001BD3 RID: 7123
		private SettingsView.ToggleSlider aoToggleSlider;

		// Token: 0x04001BD4 RID: 7124
		private SettingsView.InputSlider fovSlider;

		// Token: 0x04001BD5 RID: 7125
		private SettingsView.InputSlider fpsSlider;

		// Token: 0x04001BD6 RID: 7126
		private SettingsView.ToggleSlider cromaticAberrationSlider;

		// Token: 0x04001BD7 RID: 7127
		private SettingsView.ToggleSlider colorGainSlider;

		// Token: 0x04001BD8 RID: 7128
		private SettingsView.ToggleSlider colorValueSlider;

		// Token: 0x04001BD9 RID: 7129
		private SettingsView.ToggleSlider bloomSlider;

		// Token: 0x04001BDA RID: 7130
		private SettingsView.ToggleSlider haze;

		// Token: 0x04001BDB RID: 7131
		private Slider clipDistanceSlider;

		// Token: 0x04001BDC RID: 7132
		private Slider shakeSlider;

		// Token: 0x04001BDD RID: 7133
		private SettingsView.InputSlider detailDistanceSlider;

		// Token: 0x04001BDE RID: 7134
		private SettingsView.InputSlider uiScaleSlider;

		// Token: 0x04001BDF RID: 7135
		private Toggle depthOfFieldToggle;

		// Token: 0x04001BE0 RID: 7136
		private Toggle toggleFPS;

		// Token: 0x04001BE1 RID: 7137
		private Toggle motionBlurToggle;

		// Token: 0x04001BE2 RID: 7138
		private Toggle smokeToggle;

		// Token: 0x04001BE3 RID: 7139
		private Toggle BackgroundMaxFps;

		// Token: 0x04001BE4 RID: 7140
		private SettingsView.ToggleSlider Shadows;

		// Token: 0x04001BE5 RID: 7141
		private Dropdown imageFormatDropdown;

		// Token: 0x04001BE6 RID: 7142
		private Dropdown imageWidthDropdown;

		// Token: 0x04001BE7 RID: 7143
		private Dropdown antiAliasingDropdown;

		// Token: 0x04001BE8 RID: 7144
		private Toggle useGpuToggle;

		// Token: 0x04001BE9 RID: 7145
		private Toggle useFadeToggle;

		// Token: 0x04001BEA RID: 7146
		private CameraEffectsSettings cameraEffects;

		// Token: 0x04001BEB RID: 7147
		private VRCamera vrCamera;

		// Token: 0x04001BEC RID: 7148
		private Camera mainCamera;

		// Token: 0x04001BED RID: 7149
		private CapturePanorama capturePanorama;

		// Token: 0x04001BEE RID: 7150
		private const int VIDEO_MODE_WINDOWED = 0;

		// Token: 0x04001BEF RID: 7151
		private const int VIDEO_MODE_WINDOWED_FULLSCREEN = 1;

		// Token: 0x04001BF0 RID: 7152
		private const int VIDEO_MODE_PLATFORM_SPECIFIC = 2;

		// Token: 0x04001BF1 RID: 7153
		[CompilerGenerated]
		private static UnityAction<int> <>f__mg$cache0;

		// Token: 0x04001BF2 RID: 7154
		[CompilerGenerated]
		private static UnityAction<float> <>f__mg$cache1;

		// Token: 0x04001BF7 RID: 7159
		[CompilerGenerated]
		private static Func<Resolution, string> <>f__mg$cache2;
	}
}
